export default {
  state: {
    pathList: [
      {
        text: "南辰",
        tel: "18988557858",
        email: "223300",
        address: "安徽省蚌埠市禹会区华润熙云府5342",
        value: "北京市/北京市/东城区",
        default: 0,
      },
      {
        text: "南1",
        tel: "18988557858",
        email: "223300",
        address: "安徽省蚌埠市禹会区华润熙云府5342",
        value: "北京市/北京市/东城区",
        default: 0,
      },
      {
        text: "南2",
        tel: "18988557858",
        email: "223300",
        address: "安徽省蚌埠市禹会区华润熙云府5342",
        value:  "北京市/北京市/东城区",
        default: 0,
      },
      {
        text: "南3",
        tel: "18988557858",
        email: "223300",
        address: "安徽省蚌埠市禹会区华润熙云府5342",
        value: "北京市/北京市/东城区",
        default: 0,
      },
    ],
  },
  mutations: {
    // 添加
    addAdddress(state, preload) {
      state.pathList.unshift(preload);
    },
    // 删除
    deladdress(state,preload){
			state.pathList.findIndex(v=>{
        console.log(preload);
				return v === preload
			})
			state.pathList.splice(preload,1)
		},
    // 修改
    updatePath(state, { index, item }) {
      for (let key in item) {
        console.log(key);
        state.pathList[index][key] = item[key];
      }
    },
  },
};
